﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GridViewJqu.aspx.cs" Inherits="FishWeb.GridViewJqu" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>在页面显示GridView</title>
    <script type="text/javascript" language="javascript" src="Scripts/jquery-1.4.1.js"></script>
    <style type="text/css">
        .defalutText
        {
            font-size: italic;
            color: #CCCCCC;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
        <fieldset style="width: 400px; height: 80px;">
            <p>
                <asp:TextBox ID="txtSearch" runat="server" Width="200px" CssClass="defaultText" ToolTip="请输入搜索的关键字"></asp:TextBox>
                <asp:Button ID="btnSearch" runat="server" Text="搜索" /></p>
        </fieldset>
    </div>
    </form>
</body>
<script type="text/javascript" language="javascript">
    jQuery(document).ready(function () {
        var searchBox = jQuery("#<%=txtSearch.ClientID %>");
        searchBox.focus(function () {
            if (searchBox.val() == this.title) {
                searchBox.val("");
                searchBox.removeClass("defauleText");
            }
        });
        searchBox.blur(function () {
            if (searchBox.val() == "") {
                searchBox.val(this.title);
                searchBox.addClass("defaultText");
            }
        });
        searchBox.blur();
    });
</script>
</html>
